package me.cloudcat.develop.entity.configuration;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import me.cloudcat.develop.entity.BaseEntity;


/**
 * 
 * @author ZZWang
 * @Time 2017年1月17日  下午2:54:14
 *
 */
@Entity
@Table(name = "tbl_menu")
//@SequenceGenerator(name="SEQ_STORE", sequenceName="TBL_MENU_ID_ASQ", allocationSize=1)
public class Menu extends BaseEntity<Menu> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 编号 （唯一标示符）
	 */
	private String no;
	
	private String displayName;
	
	/**
	 * 描述
	 */
	private String description;
	
	/**
	 * 点击响应的URL
	 */
	private String url;
	
	/**
	 * 图标
	 */
	private String icon;
	
	/**
	 * 子菜单
	 */
	@OneToMany(cascade=CascadeType.ALL,mappedBy="parent")
	private List<Menu> children;
    
	@ManyToOne
	private Menu parent;
	
	/**
	 * 顺序
	 */
	private int position;

	public Menu(){
		
	}
	
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public List<Menu> getChildren() {
		return children;
	}

	public void setChildren(List<Menu> children) {
		this.children = children;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}
	public Menu getParent() {
		return parent;
	}
	public void setParent(Menu parent) {
		this.parent = parent;
	}
	
}
